<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/DatePicker/WdatePicker.js"></script>
</head>
<body>
	<h2>新增路线页面</h2>
	<form:form modelAttribute="rc" id="ff">
		<table>
			<tr>
				<td>线路名称</td>
				<td>
					<form:input path="name"/>
				</td>
			</tr>
			<tr>
				<td>优惠活动</td>
				<td>
					<form:select path="discountsId">
						<form:option value="">请选择</form:option>
						<form:options items="${discountList }" itemLabel="name" itemValue="id"/>
					</form:select>
				</td>
			</tr>
			<tr>
				<td>负责人姓名</td>
				<td>
					<form:select path="relationUserId">
						<form:option value="">请选择</form:option>
						<form:options items="${relationUserList }" itemLabel="name" itemValue="id"/>
					</form:select>
				</td>
			</tr>
			<tr>
				<td>报名时间</td>
				<td>
					<form:input path="applyTime" onclick="WdatePicker()"/>
				</td>
			</tr>
			<tr>
				<td>报名截止时间</td>
				<td>
					<form:input path="stopTime" onclick="WdatePicker()"/>
				</td>
			</tr>
			<tr>
				<td>出发时间</td>
				<td>
					<form:input path="departTime" onclick="WdatePicker()"/>
				</td>
			</tr>
			<tr>
				<td>归程时间</td>
				<td>
					<form:input path="returnTime" onclick="WdatePicker()"/>
				</td>
			</tr>
			<tr>
				<td>创建人</td>
				<td>
					<form:select path="createUserId">
						<form:option value="">请选择</form:option>
						<form:options items="${userList }" itemLabel="name" itemValue="id"/>
					</form:select>
				</td>
			</tr>
			<tr>
				<td>创建时间</td>
				<td>
					<form:input path="createTime" onclick="WdatePicker()"/>
				</td>
			</tr>
			<tr>
				<td>修改人</td>
				<td>
					<form:select path="alertUserId">
						<form:option value="">请选择</form:option>
						<form:options items="${userList }" itemLabel="name" itemValue="id"/>
					</form:select>
				</td>
			</tr>
			<tr>
				<td>修改时间</td>
				<td>
					<form:input path="alertTime" onclick="WdatePicker()"/>
				</td>
			</tr>
			<tr>
				<td>介绍</td>
				<td>
					<form:input path="introduce" />
				</td>
			</tr>
			<tr>
				<td>
					 <input onclick="saveRoute()" type="button" value="保存" /> 
				</td>
			</tr>
		</table>
	</form:form>
</body>
<script type="text/javascript">
	function saveRoute(){
		$.ajax({
			url:"<%=request.getContextPath() %>/route/saveRoute",
			type:"post",
			data:$("#ff").serialize(),
			success:function(data){
				if(data==1){
					alert("保存成功");
				}else{
					alert("保存失败")
				}
			},error:function(){
				alert("参误查")
			}
		})
	}
</script>
</html>